<?php
/**
 * RD functions.php
 *
 * Common functions and utilities
 *
 * @package RD
 */


/**
 * Return the complete url for the given menu forword
 * @param unknown_type $forward
 * @return Ambigous <string, unknown>
 */
function menu_url($forward)
{
	$astrr = explode("/",$_SERVER["REQUEST_URI"]);
	$menu_url = "HTTP://". $_SERVER['HTTP_HOST'] ."/" .$astrr[1]."/";

	if ( !empty($forward) ){
		$menu_url .= $forward;
	}
	return $menu_url;
}

/**
 * Output the debug info to page
 * @param unknown_type $str
 */
function debug($str)
{
	if(WEB_DEBUG)
	{
		echo $str.'<br>';
	}
}

/**
 * Output the unnull string
 * @param unknown_type $str
 */
function _echo($str)
{
	echo isset($str)?$str:'';
}

/**
 * Get current page from $_GET
 */
function get_current_page()
{
	return (isset($_GET[PARAM_PAGE]) && $_GET[PARAM_PAGE]>1)?$_GET[PARAM_PAGE]:1;
}

?>
